#ifndef IVEHICLE_H
#define IVEHICLE_H

#include <irrlicht.h>

using namespace irr;
using namespace scene;
using namespace video;
using namespace core;


class IVehicle
{
public:
	virtual ~IVehicle(void){};

	virtual float getMass() const = 0;

	virtual void setMass(float value) = 0;

	virtual core::vector3df getPosition() const = 0;

	virtual core::vector3df getVelocity() const = 0;

	virtual float getMaxSpeed() const = 0;

	virtual void applyForce(const core::vector3df& force) = 0;

	virtual void applySterring(const core::vector3df& steering) = 0;

	virtual void setAngle(float angle) = 0;

};


class SimpleVehicle : public IVehicle
{
public:
	SimpleVehicle();

	virtual ~SimpleVehicle(){};

	virtual float getMass() const override;

	virtual void setMass(float value) override;

	virtual core::vector3df getPosition() const override;

	virtual core::vector3df getVelocity() const override;

	virtual float getMaxSpeed() const override;

	virtual void applyForce(const core::vector3df& force) override;

	virtual void applySterring(const core::vector3df& steering) override;

	virtual void setAngle(float angle) override;


protected:
	float			mMass;
	core::vector3df mPosition;
	core::vector3df mVelocity;
	float			mSpeed;
	float			mForce;
};


class ISterring 
{
public: 
	virtual ~ISterring() {};
	virtual core::vector3df getSterring() = 0;
};


class Seek : public ISterring
{
public:
	virtual core::vector3df getSterring() override;
protected:
	IVehicle*		 mVehicle;
	core::vector3df	 mTarget;
};


class Flee : public ISterring
{
public:
	virtual core::vector3df getSterring() override;
protected:
	IVehicle* mVehicle;
	core::vector3df mTarget;
}; 


class Pursuit  : public ISterring
{
public:
	virtual core::vector3df getSterring() override;
protected:
	IVehicle*   mVehicle;
	IVehicle*   mTarget;
};


class ArrivalSteering : public ISterring
{
public: 
	virtual core::vector3df getSterring() override;
	bool init(IVehicle* vehicle, core::vector3df target, float distance);

protected:
	IVehicle* mVehicle;
	core::vector3df mTarget;
	float mSlowingDistance;
};
#endif IVEHICLE_H